<?php
/**
 * Description of ValidateCCVisa
 *
 * @author Damiano Ciarla
 */
class ValidateCCVisa implements Validate
{
    public function validate($field, $value, $condition = null)
	{
		if(!is_null($value) && strlen($value) > 0)
			if(!preg_match("/^4[0-9]{12}(?:[0-9]{3})?$/", $value))
				return TD_("Il campo", "validator") . " <b><u>" . ucfirst($field) . "</u></b> " . TD_("ha un codice non conforme allo standard VISA", "validator");

		return true;
	}
}
?>
